#include <cstdio>
#include <cstdlib>
using namespace std;


int main()
{
    typedef struct {
        int num;
        char name[20];
        char sex;
        int age;
    } student;

    int student_num = 0;
    scanf(" %d", &student_num);
    student *student_list;
    student_list = (student *)malloc(student_num * sizeof(student));

    for (int i = 0; i < student_num; i++) {
        scanf(" %d", &student_list[i].num);
        scanf(" %s", student_list[i].name);
        scanf(" %c", &student_list[i].sex);
        scanf(" %d", &student_list[i].age);
    }

    for (int i = 0; i < student_num; i++) 
        printf("%d %s %c %d\n", student_list[i].num, student_list[i].name,
                                student_list[i].sex, student_list[i].age);

    return 0;
}